from pymongo import DESCENDING

from service.ThirdService import ThirdService
from service.MongoService import MongoService
from service.RedisService import RedisService

redis_service = RedisService()

third_service = ThirdService()

mongo_service = MongoService('tao')
mongo_book = MongoService('book')


WAY_POINT = 'way_point'


if __name__ == '__main__':
    sn = 'a000005904c91b'
    location_objs = mongo_service.find(WAY_POINT, {"sn": sn}).sort([("utc", DESCENDING)])
    for location_obj in location_objs:
        print(mongo_service.toJsonStr(location_obj))
